exports.activity_collect = function(req,res) {

    var bodyParams = req.routeInfo.bodyParams;

    //最终结果
    var resultData = {};

    var forumActivityData = [];

    //任务流创建
    async.waterfall([

        //收藏
        function(cb){

            R.SEND_HTTP(
                req,
                {
                    url    : CORE_APIConfig.coreAPI.userAddCollect,
                    method : 'POST',
                    data   : {
                        uc_uid  : bodyParams.uc_uid,
                        uc_fid  : bodyParams.uc_fid,
                        uc_type : bodyParams.uc_type
                    }
                },
                function (err, data) {

                    if(err){
                        return RES.response(res,false,data);
                    }

                    cb();
                }
            );

        },

        //2.信息查询
        function (cb) {
            R.SEND_HTTP(
                req,
                {
                    url: CORE_APIConfig.coreAPI.searchForumActivity +"/fa_id/"+ bodyParams.uc_fid,
                    method: 'POST',
                    data: {
                        fields: ["fa_id", "fa_collect_count"].join(",")
                    }
                },
                function (err, data) {
                    ////console.log(data);
                    //判断是否有错误信息
                    if (err) {
                        return RES.response(res, false, "活动收藏失败");
                    }

                    forumActivityData = data.data;

                    cb();
                }
            );

        },
        //更新
        function (cb) {
            R.SEND_HTTP(
                req,
                {
                    url: CORE_APIConfig.coreAPI.updateActivity,
                    method: 'POST',
                    data: {
                        fa_id: bodyParams.uc_fid,
                        fa_collect_count:parseInt(forumActivityData[0].fa_collect_count)+1
                    }
                },
                function (err, data) {
                    ////console.log(data);
                    //判断是否有错误信息
                    if (err) {
                        return RES.response(res, false, "活动收藏失败");
                    }

                    resultData = data;
                    cb();
                }
            );

        },

    ],function(err, result){

        //返回最终拼接结果
        RES.response(res,true,resultData);

    });

}